import React, { PureComponent } from "react";
import {Redirect} from 'react-router-dom'
import { connect } from "react-redux";

class Write extends PureComponent {
  render() {
    const { loginStatu } = this.props;
    if (loginStatu) {
      return (
        <div>写文章</div>
      );
    }else{
      return <Redirect to="/login"></Redirect>
    }
  }
}

const mapState = state => ({
  loginStatu: state.getIn(["login", "login"])
});


export default connect(mapState, null)(Write);
